home *** CD-ROM | disk | FTP | other *** search
- //begin_lib <!-- Begin External JavaScript -- DO NOT REMOVE THIS LINE -->
- var c_exp = new Date();
-
- function jsCookie(){
- this.Cookies = new Array();
- this.Temporary = true;
- this.SetExpiration = c_setExpiration;
- this.CookiePath = "";
- this.CookieDomain = "";
- this.Secure = false;
- this.SetCookie = c_SetCookie;
- this.GetCookies = c_GetCookies;
- this.GetValue = c_GetValue;
- this.DeleteCookie = c_DelCookie;
- }
-
- function c_setExpiration(mil){
- this.Temporary = false;
- var s = c_exp.getTime();
- if(mil){
- c_exp.setTime(mil+s);
- }else{
- c_exp.setTime(s+(365*24*3600*1000));
- }
- }
-
- function c_SetCookie(name,value){
- var cooky = name+"="+escape(value);
- cooky += (!this.Temporary) ? "; expires="+c_exp.toGMTString() : "";
- cooky += (this.CookiePath!="") ? "; path="+this.CookiePath : "";
- cooky += (this.CookieDomain!="") ? "; domain="+this.CookieDomain : "";
- cooky += (this.Secure) ? "; secure" : "";
- document.cookie = cooky;
- }
-
- function c_GetCookies(){
- var c = unescape(document.cookie);
- var b=0; var i = 0; var l = c.length;var sc=0;
- var name="";var value="";var aname="";
- var temp = new Array();
- while(i <= l){
- i = c.indexOf("=",b);
- if(i != -1){
- name = Trim(c.substring(b,i));
- sc = c.indexOf(";",i);
- value = (sc!=-1) ? Trim(c.substring(i+1,sc)) : Trim(c.substring(i+1,l));
- var cnt = temp.length;
- temp[cnt] = new Array();
- temp[cnt].name = name;
- temp[cnt].value = value;
- b=(sc==-1) ? l : sc+1;
- }else{
- i=l+1;
- }
- }
- this.Cookies = temp;
- delete temp;
- }
-
- function c_GetValue(name){
- var r = "";
- for(var i = 0; i < this.Cookies.length; i++){
- if(this.Cookies[i].name==name){
- r = this.Cookies[i].value;
- break;
- }
- }
- return r;
- }
-
- function Trim(str){
- return (str.substring(0,1)==" ") ? str.substring(1,str.length) : str;
- }
-
- function c_DelCookie(name,path,domain,secure){
- var cooky = name+"="+"; expires=Fri, 31 Dec 1999 23:59:59 GMT";
- cooky += (path) ? "; path="+path : "";
- cooky += (domain) ? "; domain="+domain : "";
- cooky += (secure) ? "; secure" : "";
- document.cookie = cooky;
- }
-
- //end_lib <!-- End External JavaScript -- DO NOT REMOVE THIS LINE -->
-